package com.tiamo.traders.controller;

import com.tiamo.traders.entity.AboutPerson;
import com.tiamo.traders.service.AboutPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tiamo/aboutPerson")
public class AboutPersonController{
    @Autowired
    AboutPersonService aboutPersonService;

    @RequestMapping("/add")
    public int add(AboutPerson aboutPerson) {
        return aboutPersonService.add(aboutPerson);
    }

    @RequestMapping("/update")
    public int update(AboutPerson aboutPerson) {
        return aboutPersonService.update(aboutPerson);
    }

    @RequestMapping("/delete")
    public int delete(AboutPerson aboutPerson) {
        return aboutPersonService.delete(aboutPerson);
    }

    @RequestMapping("/findAll")
    public List<AboutPerson> findAll(AboutPerson aboutPerson) {
        return aboutPersonService.findAll(aboutPerson);
    }

    @RequestMapping("/findById")
    public AboutPerson findById(AboutPerson aboutPerson) {
        return aboutPersonService.findById(aboutPerson);

    }

    @RequestMapping("/getCount")
    public int getCount(AboutPerson aboutPerson) {
        return aboutPersonService.getCount(aboutPerson);
    }
}
